package projet.test;

import static org.junit.Assert.assertEquals;

import org.junit.After;
import org.junit.BeforeClass;
import org.junit.Test;

import projet.CustomException;
import projet.item.Video;

public class _TEST_Video {
	static Video video;
	
	@BeforeClass
	public static void set()
	{
		video = new Video (1, "theTitle", "comment", 2, "format", "path");
	}
	
	@After
	public void tearDown() throws Exception {

	}
	
	/**
	 * Checks that a User object is not null with constructor signature public CD (1, "theTitle", "comment","theArtist", 9);
	 */
	@Test
	public void constructor() {
		assertEquals(video.getId(), 1);
		assertEquals(video.getTitle(), "theTitle");
		assertEquals(video.getComment(), "comment");
		assertEquals(video.getTime(), 2);
		assertEquals(video.getFormat(), "format");
		assertEquals(video.getPath(), "path");
		
	}
	
	@Test(expected = CustomException.class)
	public void constructor2() throws CustomException 
	{
		new Video (1);
		System.out.println("");
	}
}
